<%--
  Created by IntelliJ IDEA.
  User: 王鹏飞
  Date: 2020/7/21
  Time: 10:35
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
    String path = request.getContextPath();
    String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jstl/fmt_rt" prefix="fmt"%>
<jsp:include page="../common/menu.jsp" />

<html>
<head>
    <title>财务收款列表</title>
</head>

<script src="<%=basePath%>js/tools.js"></script>
<body>
<div class="layui-tab">
    <ul class="layui-tab-title">
        <li class="layui-this">财务收款列表</li>
    </ul>
    <div class="layui-tab-content">
        <table class="layui-hide" id="backUser" lay-filter="backUser"></table>
    </div>
</div>


<script type="text/html" id="status">
    {{changeStatus(d.dispatchInfo.status)}}
</script>
<script type="text/html" id="auditTime">
    {{ dateFormat(d.dispatchInfo.auditTime) }}
</script>
<script type="text/html" id="collectionTime">
    {{ dateFormat(d.collectionTime) }}
</script>
</body>
</html>
<jsp:include page="../common/js.jsp" />
<script type="text/javascript">

    $('document').ready(function() {
        var layer = null;
        var laypage = null;
        var table = null;
        var form = null;
        layui.use([ "laypage", "layer", 'table' ], function() {
            layer = layui.layer;
            laypage = layui.laypage;
            table = layui.table;
            form = layui.form;

            table.render({
                elem : '#backUser',
                url : '<%=basePath%>amount/amountList',
                id : 'backUser',
                height:650,
                toolbar : '#toolbar',
                cellMinWidth : 100,
                cols : [ [
                    {
                        field : 'id',
                        title : '编号',
                        width : '5%',
                        unresize : true,
                        sort : true
                    }
                    , {
                        field : 'dispatchNum',
                        title : '派车单号',
                        width : '15%',
                        unresize : true,
                        sort : true
                    }
                    , {
                        field : 'dispatchInfo.status',
                        templet : '#status',
                        width : '13%',
                        align : 'center',
                        title : '状态'
                    }
                    , {
                        field : 'dispatchInfo.auditMoney',
                        title : '审核金额',
                        width : '10%',
                        templet : '<div>{{ d.dispatchInfo.auditMoney}}</div>',
                        sort : true
                    }
                    , {
                        field : 'dispatchInfo.auditTime',
                        title : '审核日期',
                        width : '10%',
                        templet : '#auditTime',
                        sort : true
                    }
                    , {
                        field : 'collectionTime',
                        title : '收款日期',
                        width : '10%',
                        templet : '#collectionTime',
                        sort : true
                    }
                    , {
                        field : 'amountReceived',
                        title : '已收金额',
                        width : '10%',
                        unresize : true
                    }
                    , {
                        field : 'amountReceivable',
                        title : '应收金额',
                        width : '10%',
                        sort : true
                    }
                    , {
                        field : 'amountMoney',
                        title : '实收金额',
                        width : '10%',
                        sort : true
                    }
                    , {
                        field : 'amountArear',
                        title : '欠款金额',
                        width : '10%',
                        sort : true
                    }
                    , {
                        field : 'payType',
                        title : '支付类型',
                        width : '10%',
                        templet : '<div>{{ d.dispatchInfo.payType}}</div>',
                        sort : true
                    }
                    , {
                        field : 'dispatchInfo.vehicleNum',
                        title : '车牌号码',
                        width : '10%',
                        templet : '<div>{{ d.dispatchInfo.vehicleNum}}</div>',
                        sort : true
                    }
                    , {
                        field : 'remark',
                        title : '备注',
                        width : '12%',
                        unresize : true
                    }
                ] ],
                page : true
            });

        });
    });

    function changeStatus(str) {
        var typeName = new Map();
        typeName.set(1, '未审核-未收款');
        typeName.set(2, '已审核-未收款');
        typeName.set(3, '已完成-已收款');
        typeName.set(0, '已取消');
        return typeName.get(str);
    }
</script>
